package controller;

import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;

/**
 * Auther:ws@itany.com
 * Date:20-9-16 下午4:12
 * Version:1.0
 * Description:
 */
@Component
@RequestMapping("/hello")
public class HelloContext2 {

    @RequestMapping("/f1")
    public ModelAndView f1(){
        ModelAndView mav = new ModelAndView();
        mav.setViewName("hello");
        mav.addObject("msg","Hello World");
        return mav;
    }

    @RequestMapping("/f2")
    public String f2(HttpServletRequest request){
        request.setAttribute("msg","Hello Annotation");
        return "hello";
    }

    @RequestMapping("/f3")
    public String f3(){
        return "login";
    }

}
